import request from '../request';

/**
 * 获取客户列表
 * @returns {Promise}
 */
export const getCustomers = () => {
  return request({
    url: '/customers',
    method: 'get'
  });
};

/**
 * 添加客户
 * @param {Object} data - 客户信息
 * @returns {Promise}
 */
export const addCustomer = (data) => {
  return request({
    url: '/customers',
    method: 'post',
    data
  });
};

/**
 * 更新客户信息
 * @param {string} id - 客户ID
 * @param {Object} data - 客户信息
 * @returns {Promise}
 */
export const updateCustomer = (id, data) => {
  return request({
    url: `/customers/${id}`,
    method: 'put',
    data
  });
};

/**
 * 删除客户
 * @param {string} id - 客户ID
 * @returns {Promise}
 */
export const deleteCustomer = (id) => {
  return request({
    url: `/customers/${id}`,
    method: 'delete'
  });
};